<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%><%@ 
include file="/WEB-INF/jspf/import.jspf" %><%--
--%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
        <title>车友会-会员 </title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <meta name="author" content="lijun_gz none" />
        <link rel="stylesheet" type="text/css" href="http://js.3conline.com/wap/pcauto/2014/touch/cyh.css">
    </head>
    <body class="g-doc" style="background:#fff">
       <!--栏目计数器/文章计数器-->
         <jsp:include page="/template/wap/common/counter.jspf">
            <jsp:param name="channel" value="7387" />
        </jsp:include>
        <div class="body">
           <%@include file="../common/intf6007.html" %>
            <!-- 公共头部 -->
            <div class="g-hd">
                <a href="http://m.pcauto.com.cn" class="header-home" title="太平洋汽车网"></a>
                <div class="header-title">
                    <span class="header-title-nav">
                        <a href="${WAPROOT}/">车友会</a>&nbsp;&gt;&nbsp;
                        <a href="${WAPROOT}/${myUrl}/">${fn:length(fn:escapeXml(club.name))>8?fn:substring(fn:escapeXml(club.name),0,8):fn:escapeXml(club.name)}${fn:length(fn:escapeXml(club.name))>8?"...":""}</a> > 会员
                    </span>
                </div>
            </div>
            <div class="m-section"><span class="m-section-mark">管理员</span></div>
            <div class="m-picTit" id="adm">
                <c:if test="${empty admins}"><%--加注释去掉空白
                    --%><div class="m-none" id="JLAST_VIEW_NONE" style="display: block;">
                        <span> &gt;_&lt; lll</span>
                        <p>该车友会还没有管理员哦~</p>
                    </div>
                </c:if><%--加注释去掉空白
                --%><c:forEach items="${admins}" var="m"><c:set var="u" value="${m.user}"/><%--加注释去掉空白
                    --%><a href="${UCWAPROOT}/${u.uid}/" target="_blank"><img src="${f:face(u.uid, 50)}" width="50" height="50"/><span class="m-picTit-sTit">${fn:escapeXml(u.nickname)}</span><c:if test="${m.adminType == 2}">(会长)</c:if> <c:if test="${m.adminType == 1}">(副会长)</c:if></a><%--加注释去掉空白
                        --%></c:forEach>
                </div>
                <div class="m-section"><span class="m-section-mark">会员(${countMember})</span></div>
            <div class="m-picTit" id="member">
                <c:if test="${countMember == 0}"><div class="m-none" id="JLAST_VIEW_NONE" style="display: block;">
                        <span> &gt;_&lt; lll</span>
                        <p>该车友会还没有会员哦~</p>
                    </div></c:if>
                </div>
                <div class="btn-more">
                    <a class="addmore" id="addMore" onclick="loadMember();" >
                        <span class="s1" id="showMore">加载更多</span>
                        <span class="s2" id="loadMoreNow" style="display:none">
                            <img alt="" src="http://www1.pcauto.com.cn/bbs/2013/cms/auto_index/loading.gif">加载中，请稍后
                        </span>
                    </a>
                </div>

                <script type="text/javascript" src="http://js.3conline.com/wap/2013/common/js/zepto1.1.min.js"></script>
                <script>
                    var pageNo = 1;
                    var pageSize = 20;
                    var clubId = '${requestScope.club.clubId}';
			
                    function aFunc(data) {
                    }
			
                    //请求页面，传输参数，成功回调
                    function loadMember(){
                        //拼装页面
                        var commentHtml ='<a href="${UCWAPROOT}/{m.uid}/" target="_blank">'
                            + '<img src="{imgUrl}" width="50" height="50"/>'
                            + '<span class="m-picTit-sTit">{m.nickname}</span>'
                            + '</a>';
                        var url = "${ROOT}/wap/getMemberByClubId.do?req_enc=utf-8&resp_enc=utf-8&clubId="+clubId
                            +"&pageNo=" + pageNo
                            +"&pageSize=" + pageSize
                            +"&_t="+new Date().getTime();
	    			
                        $.ajax({
                            type: 'POST',
                            url: url,
                            dataType: 'jsonp',
                            jsonpCallback:'aFunc',
                            success:function loadCommentCallBack(data){
                                if(data.result != undefined && data.result.length > 0){
                                    pageNo = data.pageNo+1;
                                    var list = data.result;
                                    $("#showMore").hide();
                                    $("#loadMoreNow").show();
                                    var resultHtml = "";
                                    for(var i = 0;i < list.length; i++){
                                        resultHtml += commentHtml.replace(/{m.uid}/ig,list[i].uid)
                                        .replace(/{imgUrl}/ig,list[i].photo)
                                        .replace(/{m.nickname}/ig,list[i].nickname);
                                    }
                                    $("#loadMoreNow").hide();
                                    $("#showMore").show();
                                    $("#member").append(resultHtml);
                                    if(list.length < pageSize){ //请求的数据若少于20行，隐藏“加载更多”
                                        $(".btn-more").hide();
                                    }
                                    if (Math.ceil(data.total*1.0/pageSize) == data.pageNo) {
                                        $(".btn-more").hide();
                                    }
                                } else {
                                    $(".btn-more").hide();
                                }
                                setHeight();
                            }
                        });
                    }
			
                    $(function() {
                        // 会员列表首屏
                        loadMember();
                    });
			
                    /*满屏功能*/
                    function setHeight(){
                        var Jfoot = document.querySelector(".g-footer");
                        var Jbody = document.querySelector(".body");
                        if (!Jfoot) return;
                        if (!Jbody) return;
                        var webHeight = document.documentElement.clientHeight,
                        JbodyHeight = Jbody.clientHeight;
                        if (JbodyHeight < webHeight) {
                            Jbody.style.height = webHeight + "px";
                            Jbody.style.position = "relative";
                            Jfoot.setAttribute("style", "width:100%;position:absolute;bottom:0px;");
                        } else {
                            Jfoot.style.position = "relative";
                        }
                    }
            </script>
            <div class="g-footer">
                <!-- 公共底部 -->
               <%@include file="../common/intf5987.html" %>
            </div>
        </div>
    </body>
</html>